package com.lxw.multidb.controller.dataharvest;

import cn.tannn.jdevelops.result.response.ResultVO;
import com.lxw.multidb.controller.dataharvest.dto.HarvestDbDTO;
import com.lxw.multidb.modules.sql.HarvestDbService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 业务数据收割
 *
 * @author lxw
 * @version V1.0
 * @date 2025/7/11 11:15
 */
@RestController
@RequestMapping("/harvest")
@RequiredArgsConstructor
@Tag(name = "数据迁移")
public class HarvestDbController {

    private final HarvestDbService harvestDbService;


    @Operation(summary = "数据库收割-执行")
    @PostMapping("db")
    public ResultVO<String> dbHarvest(@RequestBody @Valid HarvestDbDTO dbRule) {
        harvestDbService.saveDbHarvestInfo(dbRule);
        return ResultVO.success();
    }


}
